package com.xbongbong.pro.enums.lowcode;

import com.xbongbong.i18n.util.I18nMessageUtil;
import lombok.Getter;


/**
 * @author 吴峰
 * @date 2021/03/04 15:41
 */
@Getter
public enum LowCodeActionEnum {

    /**
     *
     */
    // 值改变
    ON_CHANGE(1, "onChange", "enum.lowCodeAction.memo.on_change"),

    // 表单页面被展示时（
    ON_FROM_MOUNTED(2, "onFromMounted", "enum.lowCodeAction.memo.onFromMounted"),
    // 表单提交前（*数据校验前 可阻断表单提交）
    BEFORE_FROM_SUBMIT(3, "beforeFromSubmit", "enum.lowCodeAction.memo.beforeFromSubmit"),

    // 表单提交后
    AFTER_FROM_SUBMIT(4, "afterFromSubmit", "enum.lowCodeAction.memo.afterFromSubmit"),
    LIST_BUTTON(5, "listButton", "enum.lowCodeAction.memo.listButton"),
    DETAIL_BUTTON(6, "detailButton", "enum.lowCodeAction.memo.detailButton"),
    APPROVE_BUTTON(7, "approveButton", "enum.lowCodeAction.memo.approveButton"),
    /**
     * 阶段变更前
     */
    BEFORE_STAGE_CHANGE(8, "beforeStageChange", "enum.lowCodeAction.memo.beforeStageChange"),

    //当负责团队变更时
    TEAM_CHANGES(9, "teamChanges", "enum.lowCodeAction.memo.teamChanges"),
    // 列表页快捷编辑
    ON_LIST_FIELD_EDIT(10, "onListFieldEdit", "enum.lowCodeAction.memo.onListFieldEdit"),

    /**
     * 阶段变更后
     */
    AFTER_STAGE_CHANGE(11, "afterStageChange", "enum.lowCodeAction.memo.afterStageChange"),

    /**
     * 私有化可以通用的需求同步到钉钉上来
     */
    // 新建行时（*数据校验前 可阻断表单提交）--仅给子表单字段使用
    ON_ADDROW(12, "onAddRow", "enum.lowCodeAction.memo.on_addRow"),
    // 删除行时（*数据校验前 可阻断表单提交）--仅给子表单字段使用
    ON_DELETEROW(13, "onDeleteRow", "enum.lowCodeAction.memo.on_deleteRow"),
    // 复制行时（*数据校验前 可阻断表单提交）--仅给子表单字段使用
    ON_COPYROW(14, "onCopyRow", "enum.lowCodeAction.memo.on_copyRow"),

    ;

    private Integer code;

    private String alias;


    private String memo;

    LowCodeActionEnum(Integer code, String alias, String memo) {
        this.code = code;
        this.alias = alias;
        this.memo = memo;
    }


    public String getMemo() {
        return I18nMessageUtil.getMessage(memo);
    }
}
